﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZSZ.DTO;

namespace ZSZ.Iservice
{
   public interface IRoleService:IServiceSupport
    {
        long AddNew(string roleName);
        void Update(long roleId,string roleName);
        void MarkDeleted(long roleId);
        RoleDTO GetById(long id);
        RoleDTO GetByName(string name);
        RoleDTO[] GetAll();
        /// <summary>
        /// 给用户adminuserid增加权限roleids
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="roleIds"></param>
        void AddRoles(long adminUserId,long[] roleIds);
        /// <summary>
        /// 更新角色，先删再加
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="rolesId"></param>
        void UpdateRoleIds(long adminUserId,long[] rolesId);
        /// <summary>
        /// 获取用户的角色
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <returns></returns>
        RoleDTO[] GetByAdminUserId(long adminUserId);
    }
}
